<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="header.jsp">
	<jsp:param name="title" value="管理菜单"/>
</jsp:include>
<table align="center" cellpadding="0" cellspacing="1" class="table_list">
	<caption><?=$parentid && $parentname ? '['.$parentname.'] 子' : ''?>菜单管理</caption>
	<tr>
		<th width="5%">id</th>
		<th width="30%">名称</th>
		<th width="5%">类型</th>
		<th width="30%">管理操作</th>
	</tr>
	
	<c:forEach items="${requestScope.menus}" var="menu">
	<tr>
		<td class="align_c">${menu.id}</td>
		<td><a href="">${menu.menu_name}</a></td>
		<td class="align_c"><c:choose>
			<c:when test="${menu.isdir eq 1}">目录</c:when>
			<c:otherwise>链接</c:otherwise>
		</c:choose></td>
		<td class="align_c"><c:choose>
			<c:when test="${menu.isdir eq 1}"><a href="${config.site_root}/admin?c=menu&a=manage&pid=${menu.id}">子菜单</a> | </c:when>
		</c:choose>
		<a href="${config.site_root}/admin?c=menu&a=add&id=${menu.id}">修改</a> |
		<a href="javascript:deleteConfirm('${config.site_root}/admin?c=menu&a=manage&op=delete&id=${menu.id}&pid=${requestScope.pid}')">删除</a>
		</td>
	</tr>
	</c:forEach>
</table>
<jsp:include page="footer.jsp"/>
<script language="javascript">
function deleteConfirm(url) {
	if(window.confirm('删除此菜单将同时删除它的子菜单！确定删除吗？')) {
		location.href = url;
	}
}
</script>